Promise.resolve()
  .then(
    () => {
      throw new Error("error");
    },
    () => {
      throw new Error("error");
    }
  )
  .catch((err) => {
    console.log("catch", err);
  })
  .then(() => {
    console.log("2 then");
  });

(function animation() {
  console.log("animation");
  requestAnimationFrame(animation);
})();
